﻿@{
    Layout = null;

   
}
@using System.Web.Helpers
@model YQGL.Model.DJ_QYZCXX


@helper GenerateSDYSXItem(string s)
{


    <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"> @((ViewData["SXList"] as List<SelectListItem>).FirstOrDefault(h => h.Value == s).Text):</label>
    <div class="col-lg-3">
        @Html.DropDownList("SDYSX" + s + "_DM", ViewData["SX" + s + "List"] as List<SelectListItem>, "--请选择--", new { @class = "form-control " })
    </div>
}
@helper GenerateSX()
{
    List<SelectListItem> SXList = ViewData["SXList"] as List<SelectListItem>;
    for (int i = 0; i < SXList.Count / 3; i++)
    {
       
        <div class="form-group">
          

            @GenerateSDYSXItem(SXList[i].Value)
            @GenerateSDYSXItem(SXList[i+1].Value)
            @GenerateSDYSXItem(SXList[i+2].Value)
           
        </div>
    }
    if (SXList.Count % 3 > 0)
    {

        <div class="form-group">
            @for (int i = 0; i < SXList.Count % 3; i++)
            {
            @GenerateSDYSXItem(SXList[(SXList.Count / 3)+i].Value)
          
            }
            @for (int i = 0; i < (3 - SXList.Count % 3); i++)
            {
                <div class="col-lg-4">

                </div>
            }
        </div>
    }
   

}
            <!DOCTYPE HTML>
            <html lang="en">
            <head>
                <meta charset="utf-8" />
                <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
                <meta name="viewport" content="width=device-width, initial-scale=1.0" />
                <title>企业注册</title>

                <!-- Bootstrap framework -->
                <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" />
                <!-- jQuery UI theme -->
                <link rel="stylesheet" href="lib/jquery-ui/css/Aristo/Aristo.css" />
                <!-- tooltips-->
                <link rel="stylesheet" href="lib/jBreadcrumbs/css/BreadCrumb.css" />
                <!-- tooltips-->
                <link rel="stylesheet" href="lib/qtip2/jquery.qtip.min.css" />
                <!-- colorbox -->
                <link rel="stylesheet" href="lib/colorbox/colorbox.css" />
                <!-- code prettify -->
                <link rel="stylesheet" href="lib/google-code-prettify/prettify.css" />
                <!-- sticky notifications -->
                <link rel="stylesheet" href="lib/sticky/sticky.css" />
                <!-- aditional icons -->
                <link rel="stylesheet" href="img/splashy/splashy.css" />
                <!-- flags -->
                <link rel="stylesheet" href="img/flags/flags.css" />
                <!-- datatables -->
                <link rel="stylesheet" href="lib/datatables/extras/TableTools/media/css/TableTools.css">


                <!-- main styles -->
                <link rel="stylesheet" href="css/style.css" />
                <!-- theme color-->
                <link rel="stylesheet" href="css/blue.css" id="link_theme" />

                <!--<link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
                -->
                <!-- favicon -->
                <link rel="shortcut icon" href="favicon.ico" />
                <link rel="stylesheet" href="css/bootstrap-dropselect.css" />
                <!--[if lte IE 8]>
                <link rel="stylesheet" href="css/ie.css"/>
                <![endif]-->
                <!--[if lt IE 9]>
                <script src="js/ie/html5.js"></script>
                <script src="js/ie/respond.min.js"></script>
                <script src="lib/flot/excanvas.min.js"></script>
                <![endif]-->
                <script src="js/jquery.min.js"></script>
                <script src="js/jquery.actual.min.js"></script>
                <script src="lib/validation/jquery.validate.js"></script>
                <script src="bootstrap/js/bootstrap.min.js"></script>
                <script src="@Url.Content("~/Scripts/json2.js")" type="text/javascript"></script>
                <script type="text/javascript">


                    $(document).ready(function () {



                        $("#btnPub").click(function () {
                            var that = this;
                            $(this).attr("disabled", "disabled");
                            $.ajax({
                                type: "POST",
                                url: '@Url.Content("~/InfoPub/Save")',
                                data: $('#form1').serialize(),
                                error: function (data) {
                                    alert(data);
                                    $(that).removeAttr("disabled");
                                },
                                success: function (data) {

                                    $(that).removeAttr("disabled");

                                    if (data == "操作成功") {
                                        alert("保存企业基本信息成功,待审核通过可填写企业报表!")
                                        window.location.href = '@Url.Action("Index","InfoPub")';
                                    } else {
                                        alert(data);

                                    }
                                }

                            });


                        });


                        $("#btnQYBB").click(function () {



                            window.location.href = '@Url.Action("Index", "QYBB")';
                        })

                    })

                    function ValueChangeQYDL_DM(obj) {
                     
                        $("#hdQYLXMX").val("");
                      

                        var m = obj.options[obj.selectedIndex].value
                        if (m != "") {


                            $.ajax({
                                type: "POST",
                                url: '@Url.Action("DlQuery", "InfoPub")',
                                data: { value: m },
                                async: true,
                                dataType: 'json',
                                success: function (result) {



                                    if (result != "" & typeof (result) != "undefined" & result != null) {

                                        var slt = document.getElementById("QYLX_DM");
                                        $(slt).empty();
                                        slt.options.add(new Option("请选择", ""));


                                        for (var i = 0; i < result.length; i++) {
                                            var oOption = new Option(result[i].Text, result[i].Value);

                                            slt.options.add(oOption);
                                        }
                                        var slt2 = document.getElementById("hdQYLXMX");
                                        $(slt2).empty();


                                    } else {

                                        var slt = document.getElementById("QYLX_DM");
                                        $(slt).empty();
                                    
                                    }
                                }

                            });
                        }
                    }
                    function ValueChangeQYLX_DM(obj) {

                        var m = obj.options[obj.selectedIndex].value
                        if (m != "") {

                            $("#mxText").text("请选择");
                            $.ajax({
                                type: "POST",
                                url: '@Url.Action("LXQuery", "InfoPub")',
                                data: { value: m },
                                async: true,
                                dataType: 'json',
                                success: function (result) {



                                    if (result != "" & typeof (result) != "undefined" & result != null) {



                                        var slt = document.getElementById("hdQYLXMX");
                                        $(slt).empty();
                                        slt.options.add(new Option("请选择", ""));


                                        for (var i = 0; i < result.length; i++) {
                                            var oOption = new Option(result[i].Text, result[i].Value);

                                            slt.options.add(oOption);
                                        }



                                    } else {
                                        var slt = document.getElementById("hdQYLXMX");
                                        $(slt).empty();
                                    }
                                }

                            });
                        } else {
                            var slt = document.getElementById("hdQYLXMX");
                            $(slt).empty();
                        }
                    }

                </script>


               
            </head>
            <body>
                @using (Html.BeginForm("Save", "InfoPub", FormMethod.Post, new { id = "form1", enctype = "multipart/form-data" }))
    {

                    <div style="max-width:1000px;margin-left:auto;margin-right:auto">
                        <div class="panel panel-primary">
                            <div class="panel-heading">
                                <h3 class="panel-title">
                                    企业用户注册
                                    <p class="text-center" style="color:red;font-size:12px;display:inline-block;margin-bottom:0px;margin-left:300px;">提示:请使用中文填写</p>
                                    <button type="button" class="btn btn-success btn-sm pull-right" id="btnPub" name="btnPub">保存</button>
                                </h3>
                            </div>
                            <div class="panel-body">
                                <div class="alert alert-info" role="alert">
                                    <strong>当前状态:</strong>@Model.ZTDMStr  <span class="text-primary pull-right">当前登录用户：@ViewData["LoginID"]</span>
                                </div>

                                @if (!string.IsNullOrEmpty(Model.SHXX) & Model.ZTDM != "2")
                    {


                                    <div class="alert alert-success" role="alert">审核信息：@Model.SHXX</div>

                    }
                                <div style="padding:0px 40px 0px 30px;">
                                    <div class="row">
                                        <div class="form-horizontal" role="form">
                                            <div class="form-group">
                                                <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"><span class="glyphicon glyphicon-exclamation-sign alert-danger" aria-hidden="true"></span> 企业名称:</label>
                                                <div class="col-lg-6">
                                                    <input type="text" class="form-control input-sm" id="Nsrmc" name="Nsrmc" value="@Model.Nsrmc">
                                                </div>

                                                <label class="col-xs-1 control-label input-sm">组织代码:</label>
                                                <div class="col-lg-4">
                                                    <input type="text" class="form-control input-sm" name="ZZDM" id="ZZDM" value="@Model.ZZDM">
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-xs-1 control-label input-sm">注册地址:</label>
                                                <div class="col-lg-5">
                                                    <input type="text" class="form-control input-sm" id="SCJYDZ" name="SCJYDZ" value="@Model.SCJYDZ">
                                                </div>
                                                <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"><span class="glyphicon glyphicon-exclamation-sign alert-danger" aria-hidden="true"></span>经营地址:</label>
                                                <div class="col-lg-5">
                                                    <input type="text" class="form-control input-sm" id="JYDZ" name="JYDZ" value="@Model.JYDZ">
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"><span class="glyphicon glyphicon-exclamation-sign alert-danger" aria-hidden="true"></span>  法人代表:</label>
                                                <div class="col-lg-2">
                                                    <input type="text" class="form-control input-sm" name="FDDBRMC" id="FDDBRMC" value="@Model.FDDBRMC">
                                                </div>
                                                <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"><span class="glyphicon glyphicon-exclamation-sign alert-danger" aria-hidden="true"></span>  法人电话:</label>
                                                <div class="col-lg-2">
                                                    <input type="text" class="form-control input-sm" id="FRDHHM" name="FRDHHM" value="@Model.FRDHHM">
                                                </div>
                                                <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"><span class="glyphicon glyphicon-exclamation-sign alert-danger" aria-hidden="true"></span>  联系人:</label>
                                                <div class="col-lg-2">
                                                    <input type="text" class="form-control input-sm" id="FZRMC" name="FZRMC" value="@Model.FZRMC">
                                                </div>
                                                <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"> <span class="glyphicon glyphicon-exclamation-sign alert-danger" aria-hidden="true"></span> 联系人电话:</label>
                                                <div class="col-lg-2">
                                                    <input type="text" class="form-control input-sm" name="FZRDH" id="FZRDH" value="@Model.FZRDH">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"><span class="glyphicon glyphicon-exclamation-sign alert-danger" aria-hidden="true"></span> 统计人名称:</label>
                                                <div class="col-lg-2">
                                                    <input type="text" class="form-control input-sm" id="TJRMC" name="TJRMC" value="@Model.TJRMC">
                                                </div>
                                                <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"> <span class="glyphicon glyphicon-exclamation-sign alert-danger" aria-hidden="true"></span> 统计人电话:</label>
                                                <div class="col-lg-2">
                                                    <input type="text" class="form-control input-sm" id="TjrDH" name="TjrDH" value="@Model.TjrDH">
                                                </div>
                                                <label class="col-xs-1 control-label input-sm"> 从业人数:</label>
                                                <div class="col-lg-2">
                                                    <input type="text" class="form-control input-sm" name="Cyrs" id="Cyrs" value="@(Model.Cyrs.HasValue?Model.Cyrs.Value.ToString():"")">
                                                </div>
                                                <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"> 其中本科以上:</label>
                                                <div class="col-lg-2">
                                                    <input type="text" class="form-control input-sm" id="CYRS_BK" name="CYRS_BK" value="@(Model.CYRS_BK.HasValue?Model.CYRS_BK.Value.ToString():"")">

                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"><span class="glyphicon glyphicon-exclamation-sign alert-danger" aria-hidden="true"></span> 短信号码:</label>
                                                <div class="col-lg-2">
                                                    <input type="text" class="form-control input-sm" name="DXHM" id="DXHM" value="@Model.DXHM">
                                                </div>
                                                <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"> QQ号码:</label>
                                                <div class="col-lg-2">
                                                    <input type="text" class="form-control input-sm" id="QQHM" name="QQHM" value="@Model.QQHM">
                                                </div>
                                                <label class="col-xs-1 control-label input-sm"> 电子邮件:</label>
                                                <div class="col-lg-5">
                                                    <input type="text" class="form-control input-sm" id="Email" name="Email" value="@Model.Email">
                                                </div>

                                            </div>

                                            <div class="form-group">
                                                <div class="row">
                                                    <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"> 企业分类:</label>


                                                    <div class="col-lg-3">
                                                        <div class="row">
                                                            <div class="col-lg-2 control-label">
                                                                <span class="glyphicon glyphicon-exclamation-sign alert-danger" aria-hidden="true"></span>
                                                            </div>
                                                            <div class="col-lg-10 ">
                                                                @Html.DropDownList("QYDL_DM", ViewData["DLList"] as List<SelectListItem>, "--请选择--", new { @class = "form-control ", @onchange = "ValueChangeQYDL_DM(this)" })

                                                            </div>
                                                        </div>
                                                    </div>

                                                    <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"> 企业中类:</label>
                                                    <div class="col-lg-3 ">
                                                        <div class="row">
                                                            <div class="col-lg-2 control-label">
                                                                <span class="glyphicon glyphicon-exclamation-sign alert-danger" aria-hidden="true"></span>
                                                            </div>
                                                            <div class="col-lg-10 ">
                                                                @Html.DropDownList("QYLX_DM", ViewData["LXList"] as List<SelectListItem>, "--请选择--", new { @class = "form-control ", @onchange = "ValueChangeQYLX_DM(this)", @style = "display:table-cell" })
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <label class="col-xs-1 control-label input-sm"> 企业细类:</label>
                                                    <div class="col-lg-3">
                                                        <div class="row">
                                                            <div class="col-lg-2 control-label">
                                                                <span class="glyphicon glyphicon-exclamation-sign alert-danger" aria-hidden="true"></span>
                                                            </div>
                                                            <div class="col-lg-10 ">
                                                                @Html.DropDownList("hdQYLXMX", ViewData["MXList"] as List<SelectListItem>, "--请选择--", new { @class = "form-control ", @style = "display:table-cell" })

                                                            </div>

                                                        </div>

                                                    </div>


                                                </div>

                                            </div>
                                            @GenerateSX()
                                            

                                            <div class="form-group">
                                                <label class="col-xs-1 control-label input-sm" style="white-space:nowrap"> 企业简介:</label>
                                                <div class="col-lg-11">
                                                    <textarea name="QyGH" class="form-control" id="QyGH" rows="11" cols="10">@Model.QyGH</textarea>
                                                </div>


                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    @Html.Hidden("hdMethod", ViewData["hdMethod"])
    }
            </body>
        </html>
